import request from '@/config/axios'

// 勋章信息 VO
export interface MedalVO {
  id: number // 主键
  name: string // 勋章名称
  needPoints: number // 兑换勋章所需积分
  noActivated: string // 未点亮的图标
  activated: string // 点亮后的图标
}

// 勋章信息 API
export const MedalApi = {
  // 查询勋章信息分页
  getMedalPage: async (params: any) => {
    return await request.get({ url: `/business/medal/page`, params })
  },

  // 查询勋章信息详情
  getMedal: async (id: number) => {
    return await request.get({ url: `/business/medal/get?id=` + id })
  },

  // 新增勋章信息
  createMedal: async (data: MedalVO) => {
    return await request.post({ url: `/business/medal/create`, data })
  },

  // 修改勋章信息
  updateMedal: async (data: MedalVO) => {
    return await request.put({ url: `/business/medal/update`, data })
  },

  // 删除勋章信息
  deleteMedal: async (id: number) => {
    return await request.delete({ url: `/business/medal/delete?id=` + id })
  },

  // 导出勋章信息 Excel
  exportMedal: async (params) => {
    return await request.download({ url: `/business/medal/export-excel`, params })
  },
}